/*-----------------------------------------------------------------------------
 * @file   dbg_tool.h
 * @brief  debug tools define header file
 * @author WLH<wanglehui8357@163.com> Copyright (C) 2021~2099.
 ----------------------------------------------------------------------------*/
#ifndef DBG_TOOL_H
#define DBG_TOOL_H

#include "globaldef.h"

BEGIN_DECLS

#define USE_RTT_TRACE 1u /* RTT trace tool enable flag */
/*-----------------------------------------------------------------------------
 * public functions
-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
 * file logger functions
-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------
 * trace tools functions
-----------------------------------------------------------------------------*/
/**
 * @brief print raw information
 */
void trace_out(const char* fmt, ...);
/**
 * @brief print normal information
 */
void trace_info(const char* fmt, ...);
/**
 * @brief print warning information
 */
void trace_warn(const char* fmt, ...);
/**
 * @brief print error information
 */
void trace_error(const char* fmt, ...);
/**
 * @brief print data in HEX format
 */
void trace_buffer(const U8* buf, U32 len);

#define __ASSERT(a, ...)         \
    if(!(a))                     \
    {                            \
        trace_error(__VA_ARGS__);\
    }

END_DECLS

#endif //~DBG_TOOL_H
